home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / JAVA Utilities / JProxy 1.1.0 / customers / LOGIN.JSP < prev    next >
Encoding:
Text File  |  2003-04-29  |  4.0 KB  |  129 lines

  1. <%@ page language="java" import="
  2.     java.util.*,
  3.     com.jproxy.site.ejbeans.interfaces.*,
  4.     com.jproxy.site.*"
  5.  
  6. %>
  7. <jsp:useBean id="ses" scope="session" class="com.jproxy.site.JSPSession"/>
  8. <%
  9. ses.request(pageContext);
  10. ses.setNewHit(pageContext, "hits", "Account Login", null);
  11. %>
  12.  
  13. <%
  14. String submit = request.getParameter("submit");
  15. submit = (submit==null) ? "" : submit;
  16.  
  17. String login = request.getParameter("login");
  18. login = (login==null) ? "" : login;
  19.  
  20. String password = request.getParameter("password");
  21. password = (password==null) ? "" : password;
  22.  
  23. String forwardPage = "customer-list.jsp";
  24. String buttonLogin = "Login";
  25.  
  26. // see if I was requested to logout
  27. boolean bLogout = Boolean.valueOf(request.getParameter("logout")).booleanValue();
  28.  
  29. if (bLogout) {
  30.   ses.session.logoff();
  31.   ses.setLogin(null);
  32. }
  33. else
  34.   {
  35.     if(submit.equalsIgnoreCase(buttonLogin))
  36.     {
  37.       try {
  38.         ICustomer account = (ICustomer)ses.session.login(login, password);
  39.         ses.setLogin(account);
  40.         if(account!=null)
  41.         {
  42.             Properties p = new Properties();
  43.             String description = "Account Name: : "+account.getCustomerName()+", EMail: "+account.getEMail()+", Password: "+account.getPassword();
  44.             p.put("description", description);
  45.             ses.setNewHit(pageContext, "events", "Customer Account Login", p);
  46.         }
  47.       } catch (Exception e) {
  48.         e.printStackTrace();
  49.       }
  50.     }
  51.  
  52.     if(ses.getLogin()!=null)
  53.     {
  54.         if (!ses.getLogin().getHasClients())
  55.           forwardPage = "product-list.jsp";
  56.     %>
  57.         <jsp:forward page="<%=forwardPage%>">
  58.         </jsp:forward>
  59.     <%
  60.     }
  61. }
  62. %>
  63.  
  64. <!-- HEADER -->
  65. <jsp:include page="header.jsp" flush="true">
  66.   <jsp:param name="pageId" value="login"/>
  67. </jsp:include>
  68.  
  69. <br>
  70. <table class="h9Verdana" cellpadding="5" width="100%" border="0">
  71. <!-- Prolog -->
  72.   <tr>
  73.     <td>
  74.       ePortal is a restricted area available to our Customers and Partners only.
  75.       <p>
  76.       ePortal allows to manage product licenses, provides access to additional technical resources,
  77.       grants access to the latest builds and more.
  78.       <p>
  79.       If you would like to become our Partner please
  80.       <a class="h8VerdanaBold" href="<%=JSPRes.path%>/main/partners.jsp">read more</a> on our
  81.       partnership program. If you're ready to buy JProxy Tunnel commercial license
  82.       please visit our <a class="h8VerdanaBold" href="<%=JSPRes.path%>/main/buy.jsp">buy</a> page.
  83.       <p>
  84.       Please enter your ePortal login and password to proceed.
  85.  
  86.       <form method=POST action=<%=JSPRes.path%>/main/customers/login.jsp>
  87.       <table class="h9Verdana" border="0" bgcolor="9c9cff" cellpadding="1" cellspacing="0">
  88.         <tr>
  89.           <td>
  90.              ePortal Login
  91.           </td>
  92.         </tr>
  93.         <tr>
  94.           <td>
  95.             <table class="h9Verdana" border="0" bgcolor="white" cellpadding="5" cellspacing="1" border=0>
  96.               <tr class="h8Verdana">
  97.                 <td width="35%" align="right">
  98.                   <br>Login name:
  99.                 </td>
  100.                 <td align="left">
  101.                   <br><input type="text" name="login" size="20" maxlength="20" value="">
  102.                 </td>
  103.               </tr>
  104.               <tr class="h8Verdana">
  105.                 <td align="right">
  106.                   Password:
  107.                 </td>
  108.                 <td align="left">
  109.                   <input type="password" name="password" size="20" maxlength="20" value="">
  110.                 </td>
  111.               </tr>
  112.               <tr class="h8Verdana">
  113.                 <td></td>
  114.                 <td align="right">
  115.                   <br><INPUT name=submit style="HEIGHT: 24px; WIDTH: 70" type=submit value="<%=buttonLogin%>">
  116.                 </td>
  117.               </tr>
  118.             </table>
  119.           </td>
  120.         </tr>
  121.       </table>
  122.       </form>
  123.     </td>
  124.   </tr>
  125. </table>
  126.  
  127. <!-- FOOTER -->
  128. <jsp:include page="footer.jsp" flush="true"/>
  129.